package Buttons
{
	import flash.events.MouseEvent;
	
	/**
	 * ...
	 * @author Lokiraze
	 */
	public class Check extends Buttons 
	{
		private var game:Game;
		
		public function Check(g:Game)
		{
			game = g;
			this.Draw();
			this.addEventListener(MouseEvent.CLICK, Checked)
		}
		
		public function Draw()
		{
			txtButton.selectable = false;
			txtButton.text = "Check";
		}
		
		public function Checked(e:MouseEvent)
		{			
			for (var i:int = 0; i < game.gridCells.length; i++)
			{
				if (!game.gridCells[i].isRevealed())
				{
					if(!game.gridCells[i].Right() && game.gridCells[i].state == "Answer")
					{
						game.gridCells[i].Correction();
					}
				}
			}
		}
	}
	
}